const zlib = require('zlib');
let request = require('request');
var rawproto = require('rawproto')
var textEncoding = require('text-encoding');
var TextDecoder = textEncoding.TextDecoder;
const urlUtil = require('../../util/urlUtil');
const { md5 } = require('../../util/crypto');
const gUrl = {
    // 快代理 api
    getdps: 'http://dps.kdlapi.com/api/getdps/',
    getdpsvalidtime: 'https://dps.kdlapi.com/api/getdpsvalidtime',

    // dy api
    // getGorgon: 'http://127.0.0.1:8010/getGorgon',
    getGorgon: 'http://192.168.0.25:8010/getGorgon',
    getUserInfoByUserId: 'https://aweme-eagle.snssdk.com/aweme/v1/user/',
    getUserInfoBySecUserId: 'https://aweme-eagle.snssdk.com/aweme/v1/user/',
    getMyInfo: 'https://aweme-eagle.snssdk.com/aweme/v1/user/',
    followUser: 'https://aweme.snssdk.com/aweme/v1/commit/follow/user/',
    diggVideo: 'https://aweme.snssdk.com/aweme/v1/commit/item/digg/',
    commentVideo: 'https://aweme.snssdk.com/aweme/v1/comment/publish/',
    feedFirstList: 'https://aweme.snssdk.com/aweme/v2/feed/',
    feedNextList: 'https://aweme-eagle.snssdk.com/aweme/v2/feed/',
    commentList: 'https://aweme.snssdk.com/aweme/v2/comment/list/',
    // https://aweme.snssdk.com/aweme/v2/feed/?type=0&max_cursor=0&min_cursor=0&count=6&volume=0.0&pull_type=0&need_relieve_aweme=0&filter_warn=0&req_from=enter_auto&is_cold_start=1&longitude=0&latitude=0&address_book_access=2&gps_access=2&cached_item_num=0&last_ad_show_interval=-1&mac_address=97%3A16%3A5a%3A1d%3A19%3A99&discard_cids=1681346255565859&action_mask=-1&ad_extra=%7B%22topview_type%22%3A0%7D&pass_through&top_red_packet=false&use_dialect=false&red_packet_guide=false&filter_live_cell=false&os_api=23&device_type=MI%204LTE&ssmix=a&manifest_version_code=110100&dpi=480&uuid=861218566506650&app_name=douyin_lite&version_name=11.1.0&ts=1603723134&app_type=normal&ac=wifi&update_version_code=11109902&channel=xinyou_dylite_and19&_rticket=1603723134159&device_platform=android&iid=4239331091290686&version_code=110100&mac_address=97%3A16%3A5a%3A1d%3A19%3A99&cdid=c3399ce7-f29b-4ab7-b48c-ffdeebe20630&openudid=16d9eeb4b1210159&device_id=52595876448&resolution=1080*1920&os_version=6.0.1&language=zh&device_brand=Xiaomi&aid=2329&mcc_mnc=00000
    // https://aweme-eagle.snssdk.com/aweme/v2/feed/?type=0&max_cursor=0&min_cursor=-1&count=6&volume=0.0&pull_type=2&need_relieve_aweme=0&filter_warn=0&req_from&is_cold_start=0&longitude=0&latitude=0&address_book_access=2&gps_access=2&cached_item_num=3&last_ad_show_interval=3&mac_address=97%3A16%3A5a%3A1d%3A19%3A99&action_mask=0&ad_extra=%7B%22topview_type%22%3A0%7D&pass_through&top_red_packet=false&use_dialect=false&red_packet_guide=false&filter_live_cell=false&os_api=23&device_type=MI%204LTE&ssmix=a&manifest_version_code=110100&dpi=480&uuid=861218566506650&app_name=douyin_lite&version_name=11.1.0&ts=1603705151&app_type=normal&ac=wifi&update_version_code=11109902&channel=xinyou_dylite_and19&_rticket=1603705152015&device_platform=android&iid=4239331091290686&version_code=110100&mac_address=97%3A16%3A5a%3A1d%3A19%3A99&cdid=c3399ce7-f29b-4ab7-b48c-ffdeebe20630&openudid=16d9eeb4b1210159&device_id=52595876448&resolution=1080*1920&os_version=6.0.1&language=zh&device_brand=Xiaomi&aid=2329&mcc_mnc=00000
    // https://aweme.snssdk.com/aweme/v2/comment/list/?aweme_id=6884156750723812615&cursor=0&count=20&address_book_access=2&gps_access=2&forward_page_type=1&os_api=23&device_type=MI%204LTE&ssmix=a&manifest_version_code=110100&dpi=480&uuid=861218566506650&app_name=douyin_lite&version_name=11.1.0&ts=1603705917&app_type=normal&ac=wifi&update_version_code=11109902&channel=xinyou_dylite_and19&_rticket=1603705917782&device_platform=android&iid=4239331091290686&version_code=110100&mac_address=97%3A16%3A5a%3A1d%3A19%3A99&cdid=c3399ce7-f29b-4ab7-b48c-ffdeebe20630&openudid=16d9eeb4b1210159&device_id=52595876448&resolution=1080*1920&os_version=6.0.1&language=zh&device_brand=Xiaomi&aid=2329&mcc_mnc=00000
}
const gHeader = {
    "sdk-version": "1",
    "x-ss-dp": "2329",
    "user-agent": "com.ss.android.ugc.aweme.lite/110100 (Linux; U; Android 6.0.1; zh_CN; MI 4LTE; Build/MMB29M; Cronet/TTNetVersion:4df3ca9d 2019-11-25)",
    "accept-encoding": "gzip, deflate, br",
}
const gUserInfo = {
    nickname: '',
    uid: '',
    sec_uid: '',
    short_id: '',
    dongtai_count: 0, // 动态数
    aweme_count: 0,  // 视频数
    follower_count: 0, // 粉丝数
    following_count: 0, // 关注数
    total_favorited: 0, // 获赞数
}
const cRes = {
    code: 0,
    data: '',
    msg: ''
};

const cUserInfo = {
    nickname: '',
    uid: '',
    short_id: '',
    gender: 0,
    avatar:''
};

// 设置代理，忽略证书检查、自动重定向
let option = {
    // proxy: 'http://127.0.0.1:8888',
    rejectUnauthorized: false,
    followRedirect: false,
    encoding: null,
};

function setProxy(proxy) {
    option.proxy = "http://" + proxy;
}

function getdps(orderId, code, apiKey) {
    let param = {
        orderid: orderId,
        signature: apiKey,
        num: 1,
        area: code,
        format: 'json',
    }
    let url = gUrl.getdps + urlUtil.getUrlParam(param);
    return new Promise((resolve, reject) => {
        request.get(url,
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    console.log('res ok: ' + body);
                    resolve(JSON.parse(body));
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

function getdpsvalidtime(orderId, proxy, apiKey) {
    let param = {
        orderid: orderId,
        proxy: proxy,
        signature: apiKey,
    }
    let url = gUrl.getdpsvalidtime + urlUtil.getUrlParam(param);
    return new Promise((resolve, reject) => {
        request.get(url,
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    console.log('res ok: ' + body);
                    resolve(JSON.parse(body));
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

async function getUserInfoByUserId(urlParam, header, userId) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);
    let param = {
        "user_id": userId,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }
    let url = gUrl.getUserInfoByUserId + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);
                    console.log('body: ' + body);

                    body = JSON.parse(body);
                    let userInfo = { ...gUserInfo };
                    userInfo.nickname = body.user.nickname;
                    userInfo.uid = body.user.uid;
                    userInfo.sec_uid = body.user.sec_uid;
                    userInfo.short_id = body.user.short_id;
                    userInfo.dongtai_count = body.user.dongtai_count;
                    userInfo.aweme_count = body.user.aweme_count;
                    userInfo.follower_count = body.user.follower_count;
                    userInfo.following_count = body.user.following_count;
                    userInfo.total_favorited = body.user.total_favorited;
                    console.log(userInfo);
                    resolve(userInfo);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

async function getUserInfoBySecUserId(urlParam, header, secUserId) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);
    let param = {
        "sec_user_id": secUserId,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }
    let url = gUrl.getUserInfoBySecUserId + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);
                    console.log('body: ' + body);

                    body = JSON.parse(body);
                    let userInfo = { ...gUserInfo };
                    userInfo.nickname = body.user.nickname;
                    userInfo.uid = body.user.uid;
                    userInfo.sec_uid = body.user.sec_uid;
                    userInfo.short_id = body.user.short_id;
                    userInfo.dongtai_count = body.user.dongtai_count;
                    userInfo.aweme_count = body.user.aweme_count;
                    userInfo.follower_count = body.user.follower_count;
                    userInfo.following_count = body.user.following_count;
                    userInfo.total_favorited = body.user.total_favorited;
                    console.log(userInfo);
                    resolve(userInfo);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

async function getMyInfo(urlParam, header) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);

    let param = {
        "is_after_login": 0,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }
    let url = gUrl.getMyInfo + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);
                    console.log('body: ' + body);

                    body = JSON.parse(body);
                    let userInfo = { ...gUserInfo };
                    userInfo.nickname = body.user.nickname;
                    userInfo.uid = body.user.uid;
                    userInfo.sec_uid = body.user.sec_uid;
                    userInfo.short_id = body.user.short_id;
                    userInfo.dongtai_count = body.user.dongtai_count;
                    userInfo.aweme_count = body.user.aweme_count;
                    userInfo.follower_count = body.user.follower_count;
                    userInfo.following_count = body.user.following_count;
                    userInfo.total_favorited = body.user.total_favorited;
                    console.log(userInfo);
                    resolve(userInfo);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

/**
 * 
 * @param {}} type 1-关注 0-取消
 */
async function followUser(urlParam, header, type, userId, secUserId) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);

    let param = {
        "channel_id": 3,
        "from_pre": 13,
        "from": 19,
        "type": type,
        "user_id": userId,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
        "sec_user_id": secUserId,
    }
    let url = gUrl.followUser + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);
                    console.log('body: ' + body);
                    resolve(body);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

/**
 * 
 * @param {*} aweme_id 视频id
 * @param {*} type 1-点赞 0-取消
 */
async function diggVideo(urlParam, header, aweme_id, type) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);

    let param = {
        "aweme_id": aweme_id,
        "type": type,
        "channel_id": 3,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }
    let url = gUrl.diggVideo + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);
                    console.log('body: ' + body);
                    resolve(body);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

async function commentVideo(urlParam, header, aweme_id, comment) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);

    let param = {
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }
    let form = {
        aweme_id: aweme_id,
        text: comment,
        text_extra: '[]',
        is_self_see: '0',
        sticker_id: '',
        sticker_source: '0',
        sticker_width: '0',
        sticker_height: '0',
        channel_id: '0',
        ad_info: ''
    };
    let postMd5 = md5(urlUtil.getUrlParamNoQue(form));
    let url = gUrl.commentVideo + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, postMd5);
    return await new Promise((resolve, reject) => {
        request.post({
            url: url,
            form: { ...form },
            ...option,
            headers: {
                "cookie": cookie,
                "x-ss-req-ticket": ticket,
                "x-tt-token": token,
                "x-ss-stub": postMd5,
                ...gHeader,
                "x-gorgon": xGorgon,
                "x-khronos": sTicket,
            }
        }, function (err, response, body) {
            if (!err && response.statusCode == 200) {
                body = getResponseData(response, body);
                console.log('body: ' + body);
                resolve(body);
            } else {
                console.log('res err: ' + err);
                reject(err);
            }
        });
    });
}

function getGorgon(tick, url, cookie, postMd5) {
    return new Promise((resolve, reject) => {
        request.post({
            url: gUrl.getGorgon,
            form: {
                tick: tick,
                url: url,
                cookie: cookie,
                postMd5: postMd5
            },
            // ...option
        }, function (err, response, body) {
            if (!err && response.statusCode == 200) {
                console.log('res ok: ' + body);
                resolve(body);
            } else {
                console.log('res err: ' + err);
                reject(err);
            }
        })
    });
}

function getAccountInfo(urlParam, header) {
    let cookie = "", token = "";
    let jsonParam = urlUtil.getUrlJson(urlParam);
    let jsonHeader = JSON.parse(header);
    for (let index in jsonHeader) { // 数组
        let jobj = jsonHeader[index];
        switch (jobj.first.toLowerCase()) {
            case 'cookie':
                cookie = jobj.second;
                break;
            case 'x-tt-token':
                token = jobj.second;
                break;
            default:
                break;
        }
    };
    return { cookie, token, jsonParam };
}

function getResponseData(response, body) {
    let contentEncoding = response.headers['content-encoding'];
    console.log('contentEncoding: ' + contentEncoding);
    switch (contentEncoding) {
        case 'br':
            body = zlib.brotliDecompressSync(body);
            break;
        case 'gzip':
            body = zlib.gunzipSync(body);
            break;
        case 'deflate':
            body = zlib.inflateSync(body);
            break;
    }
    return body;
}

async function feedFirstList(urlParam, header) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);

    let param = {
        "type": 0,
        "max_cursor": 0,
        "min_cursor": 0,
        "count": 6,
        "volume": 0.0,
        "pull_type": 0,
        "need_relieve_aweme": 0,
        "filter_warn": 0,
        "req_from": 'enter_auto',
        "is_cold_start": 1,
        "longitude": 0,
        "latitude": 0,
        "address_book_access": 2,
        "gps_access": 2,
        "cached_item_num": 0,
        "last_ad_show_interval": -1,
        "action_mask": -1,
        "ad_extra": '{"topview_type":0}',
        "pass_through": '',
        "top_red_packet": false,
        "use_dialect": false,
        "red_packet_guide": false,
        "filter_live_cell": false,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }

    let url = gUrl.feedFirstList + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);
                    let arr = rawproto.getData(body);
                    let awemeId = '';
                    let awemeArr = [];
                    for (let itm of arr) {
                        if ('5' in itm) {
                            let obj = itm['5'];
                            console.log(Object.prototype.toString.call(obj))
                            if (obj instanceof Array) {
                                awemeId = obj[0]['1'];
                                awemeArr.push(awemeId);
                                console.log(awemeId)
                            } else if (obj instanceof Uint8Array) {
                                awemeId = new TextDecoder("utf-8").decode(obj);
                                awemeId = awemeId.substr(2, 19);
                                awemeArr.push(awemeId);
                                console.log(awemeId);
                            }
                        }
                    }

                    let res = { ...cRes };
                    if(awemeArr.length == 0) {
                        res.code = 1;
                        res.msg = "获取First推荐视频列表失败";
                    } else {
                        res.data = awemeArr;
                    }
                    console.log(res);
                    resolve(res);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

async function feedNextList(urlParam, header) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);

    let param = {
        "type": 0,
        "max_cursor": 0,
        "min_cursor": -1,
        "count": 6,
        "volume": 0.0,
        "pull_type": 2,
        "need_relieve_aweme": 0,
        "filter_warn": 0,
        "req_from": '',
        "is_cold_start": 0,
        "longitude": 0,
        "latitude": 0,
        "address_book_access": 2,
        "gps_access": 2,
        "cached_item_num": 7,
        "last_ad_show_interval": 14,
        "action_mask": 0,
        "ad_extra": '{"topview_type":0}',
        "pass_through": '',
        "top_red_packet": false,
        "use_dialect": false,
        "red_packet_guide": false,
        "filter_live_cell": false,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }

    let url = gUrl.feedNextList + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);
                    let arr = rawproto.getData(body);
                    let awemeId = '';
                    let awemeArr = [];
                    for (let itm of arr) {
                        if ('5' in itm) {
                            let obj = itm['5'];
                            console.log(Object.prototype.toString.call(obj))
                            if (obj instanceof Array) {
                                awemeId = obj[0]['1'];
                                awemeArr.push(awemeId);
                                console.log(awemeId)
                            } else if (obj instanceof Uint8Array) {
                                awemeId = new TextDecoder("utf-8").decode(obj);
                                awemeId = awemeId.substr(2, 19);
                                awemeArr.push(awemeId);
                                console.log(awemeId);
                            }
                        }
                    }
                    
                    let res = { ...cRes };
                    if(awemeArr.length == 0) {
                        res.code = 1;
                        res.msg = "获取Next推荐视频列表失败";
                    } else {
                        res.data = awemeArr;
                    }
                    console.log(res);
                    resolve(res);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

async function commentList(urlParam, header, aweme_id, cursor) {
    let ticket = new Date().getTime();
    let sTicket = parseInt(ticket / 1000);
    let { cookie, token, jsonParam } = getAccountInfo(urlParam, header);

    let param = {
        "aweme_id": aweme_id,
        "cursor": cursor,
        "count": 20,
        "address_book_access": 2,
        "gps_access": 2,
        "forward_page_type": 1,
        ...jsonParam,
        "ts": sTicket,
        "_rticket": ticket,
    }

    let url = gUrl.commentList + urlUtil.getUrlParam(param);
    let xGorgon = await getGorgon(sTicket, url, cookie, '');
    return await new Promise((resolve, reject) => {
        request.get(url,
            {
                ...option,
                headers: {
                    "cookie": cookie,
                    "x-ss-req-ticket": ticket,
                    "x-tt-token": token,
                    ...gHeader,
                    "x-gorgon": xGorgon,
                    "x-khronos": sTicket,
                }
            },
            function (err, response, body) {
                if (!err && response.statusCode == 200) {
                    body = getResponseData(response, body);                    
                    body = JSON.parse(body);
                    let res = { ...cRes };
                    let comments = [];
                    if(body.status_code == 0) {
                        for (let itm of body.comments) {
                            let comment = {...cUserInfo};
                            comment.nickname = itm.user.nickname;
                            comment.uid = itm.user.uid;
                            comment.short_id = itm.user.short_id;
                            comment.gender = itm.user.gender;
                            comment.avatar = itm.user.avatar_larger.url_list[0];
                            comments.push(comment);
                        }
                        res.data = comments;
                    } else {
                        res.code = 1;
                        res.msg = "获取视频评论列表失败";
                    }

                    console.log(res);
                    resolve(res);
                } else {
                    console.log('res err: ' + err);
                    reject(err);
                }
            }
        );
    });
}

module.exports = {
    getdps,
    getdpsvalidtime,

    getGorgon,
    setProxy,
    getUserInfoByUserId,
    getUserInfoBySecUserId,
    getMyInfo,
    followUser,
    diggVideo,
    commentVideo,
    feedFirstList,
    feedNextList,
    commentList,
}